<%-- 
    Document   : printcook
    Created on : Dec 12, 2011, 11:45:21 PM
    Author     : Venus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*,Beans.ThamSoHT,Models.ThamSoHT_Model, Models.DauBep_Model, Models.MonAn_Model, Models.DonViTinh_Model, Models.TuyChon_Model, Models.NhanVien_Model"%>
<%
            int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
            String dsts = " 'order', 'food', 'foodlist', 'notes', 'sl', 'dvt' ";
            ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.

            String dvt = mdsts[0].getTenTS();
            String food = mdsts[1].getTenTS();
            String foodlist = mdsts[2].getTenTS();
            String notes = mdsts[3].getTenTS();
            String order = mdsts[4].getTenTS();
            String sl = mdsts[5].getTenTS();
            

            String MaMA = (String) request.getAttribute("MaMA");
            String SL = (String) request.getAttribute("SL");
            String DVT = (String) request.getAttribute("DVT");
            String GC = (String) request.getAttribute("GC");
            String tendn = (String) request.getAttribute("tendn");
            String diachi = (String) request.getAttribute("diachi");
            String sodt = (String) request.getAttribute("sodt");
            String ngaygio = (String) request.getAttribute("ngaygio");
            String manv = (String) request.getAttribute("manv");
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>i-Order</title>
        <link rel="icon" href="images/icon.png" />
        <link rel="shortcut icon" href="images/icon.png" />
        <link rel="apple-touch-icon" href="images/icon.png"/>
        <link rel="apple-touch-icon-precomposed" href="images/icon.png"/>
        <link href="css/statics.css" type="text/css" rel="stylesheet" />
        <title>JSP Page</title>
    </head>
    <body >
        <div style=" width: 40%; background: #f5e3c0;">
        <div style=" padding: 4px;">
            <div style="text-align: left; text-transform: uppercase; font-size: 20px; margin-bottom: 10px; color: #242323; font-weight: bold;"><%=tendn%></div>
            <div style="text-align: left; margin-bottom: 5px; color: #242323;"><img style=" margin-right: 8px;" alt="" src="images/download2.png"><%=diachi%></div>
            <div style="text-align: left; color: #242323;"><img style=" margin-right: 5px;" alt="" src="images/phone.png"><%=sodt%></div>
            <div style="text-align: left; color: #242323; margin-top: 20px; height: 23px;"><img style=" margin-right: 5px;" alt="" src="images/user12.png"><span style="vertical-align: top;"><%=NhanVien_Model.LayTenNV(Integer.parseInt(manv)) %></span></div>
        </div>
        <div style="  text-transform: uppercase; clear: both; font-size: 18px; margin-bottom: 20px; font-weight: bold; text-align: center; margin-top: 15px;"><%=foodlist%></div>
                 
        <table style=" width: 100%; ">
            <thead>
            <td style=" width: 7%; color: #242323; font-weight: bold; "><%=order%></td>
            <td style=" width: 25%; color: #242323; font-weight: bold; "><%=food%></td>
            <td style=" width: 10%; color: #242323; font-weight: bold; "><%=dvt%></td>
            <td style=" width: 5%; color: #242323; font-weight: bold; "><%=sl%></td>
            <td style=" color: #242323; font-weight: bold; "><%=notes%></td>
            </thead>
            <tbody>
                <%
                            String mamonan[] = MaMA.split(";");
                            String soluong[] = SL.split(";");
                            String donvitinh[] = DVT.split(";");
                            String ghichu[] = GC.split(";");
                                    for (int i = 0; i < mamonan.length; i++) {%>
                <tr>
                    <td><%=i + 1%></td>
                    <td><%=MonAn_Model.LayTenMA(Integer.parseInt(mamonan[i]), langid)%></td>
                    <td><%=DonViTinh_Model.LayTenDVT(Integer.parseInt(donvitinh[i]), langid)%></td>
                    <td><%=soluong[i]%></td>
                    <td><%=ghichu[i]%></td>
                </tr>
                <%  }%>
                <tr>
                <td colspan="5" style="padding-top: 20px; text-align: right;"><%=ngaygio%></td>
            </tr>
            </tbody>
        </table>
    </div>
    </body>
</html>
